<!DOCTYPE html>
<!-- saved from url=(0030)http://www.szuavia.org/mobile/ -->
<html class="am-touch js cssanimations"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>会员注册_{{config('sys.siteName')}}</title>
    <meta name="description" content="会员注册">
    <meta name="keywords" content="会员注册">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="http://at.alicdn.com/t/c/font_3868774_fnqknxd4emo.css">
    <link rel="stylesheet" href="{{$temps_src}}/file/amazeui.css">
    <link rel="stylesheet" href="{{$temps_src}}/file/public.css"> 
    <link rel="stylesheet" href="{{$temps_src}}/file/index.css">
    <script src="{{$temps_src}}/file/hm.js"></script><script src="{{$temps_src}}/file/jquery.min.js"></script> 
    <script src="{{$temps_src}}/file/amazeui.min.js"></script>
    <script src="{{$temps_src}}/file/public.js"></script>
    <script src="{{$temps_src}}/file/template-web.js"></script>
    <link rel="stylesheet" href="/admin/css/xadmin.css"> 
    <script src="/admin/lib/layui/layui.js" charset="utf-8"></script>
    <style>
    .news .am-list-news-bd .am-list li{
        padding: 0.5rem 0;
    }  

    </style>
<style id="ai-assist-right-style">
    html.ai-assist-html {
      width: calc(100% - 480px)!important;
      position: relative!important;
      min-height: 100vh!important
    }
    .ai-assist-highlight {
      background: yellow;
    }
  </style></head>
<body class="am-with-topbar-fixed-top"> 
@include('home.mobile.header')
<style>
        * {
            margin: 0;
            padding: 0;
        }
        html {
            height: 100%;
        }
        body {
            height: 100%;
        }
        .container {
            height: 100%;
            background-image: linear-gradient(to bottom, #036, #a6c1ee);
        }
        .login-wrapper {
            background-color: #fff;
            width: 358px;
            height: 720px;
            border-radius: 15px;
            padding: 0 25px;
            position: relative;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
        .header {
            font-size: 28px;
            font-weight: bold;
            text-align: center;
            line-height: 120px;
        }
        .input-item {
            display: block;
            width: 100%;
            margin-bottom: 12px;
            border: 0;
            padding: 10px;
            border-bottom: 1px solid rgb(128, 125, 125);
            font-size: 15px;
            outline: none;
        }
        .input-item:placeholder {
            text-transform: uppercase;
        }
        input[type="radio"]{
            width:20px;
            height:20px;
            vertical-align: middle;
            margin-bottom:5px;
        }
        .btn {
            text-align: center;
            padding: 10px;
            width: 100%;
            margin-top: 40px;
            background-image: linear-gradient(to bottom, #036, #a6c1ee);
            color: #fff;
        }
        .msg {
            text-align: center;
            line-height: 88px;
        }
        a {
            text-decoration-line: none;
            color: #abc1ee;
        }
        label{
            margin-left: 28px;
            margin-bottom:10px;
            font-size: 16px;
            color:#036;
        }
        .radio-group{
            line-height:38px;
        }
</style>
<div class="container">
        <div class="login-wrapper">
            <div class="header">会员注册</div>
            <div class="form-wrapper">
                <form id="myRegister">
  <div class="radio-group">
    <label>
      <input type="radio" name="type" value="1" checked >
      <span>个人会员</span>
    </label>
    <label>
      <input type="radio" name="type" value="2">
      <span>单位会员</span>
    </label>
  </div>
                <input type="text" id="name" name="name" required placeholder="用户名" class="input-item">
                <input type="password" id="password" name="password" required placeholder="密码" class="input-item">
                <input type="password" id="repassword" name="repassword" required placeholder="确认密码" class="input-item">
                <input type="text" id="nickname" name="nickname" required placeholder="姓名" class="input-item">
                <input type="text" id="idCard" name="idCard" required placeholder="身份证号码" class="input-item">
                <input type="text" id="phone" name="phone" required placeholder="电 话号码" class="input-item">
                <input type="text" id="email" name="email" required placeholder="邮 箱" class="input-item">
                <input type="text" id="address" name="address" required placeholder="地 址" class="input-item">
                <div class="btn login_btn" style="padding:0px;"><input style="background: none;font-size: 20px;border: none;width: 100%;height: 100%;padding: 10px;" type="submit" value="注  册"></div>
                </form>
            </div>
            <div class="msg">
                已有账号?
                <a href="/login" style="color:#036;font-size:16px;font-weight:bold;">立即登录</a>
            </div>
        </div>
    </div>    
<script>
    // 根据不同选项显示不同的表单
    const person = document.querySelector('input[value="1"]');
    const company = document.querySelector('input[value="2"]');
    person.addEventListener('change', showResult);
    company.addEventListener('change', showResult);
    function showResult() {
        if (person.checked) {
            console.log(111111);
            $('#nickname').attr('placeholder', '姓名');
            $('#idCard').attr('placeholder', '身份证号码');
        } else if (company.checked) {
            console.log(222222);
            $('#nickname').attr('placeholder', '单位名称');
            $('#idCard').attr('placeholder', '机构代码');
        }
}
    layui.use(['form', 'layer'],
    $(document).ready(function() {
        $('#myRegister').submit(function(e) {
        e.preventDefault(); // 阻止表单默认提交行为
        var password = $('#password').val()
                    var repassword = $('#repassword').val()
                    if(password != repassword){
                        layer.alert('两次输入密码不同，请重新输入', {
                                        icon: 5,
                                        time:2500,
                                        end:function () {
                                            location.reload()
                                        }
                                    })
                    }else{
        $.ajax({
            type: 'POST',
            url: '/doregister', // PHP后端处理文件的URL
            dataType:'json',
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        },
            data: $(this).serialize(), // 自动序列化表单数据
            success: function(data) {
                console.log(data); // 处理成功后的回调函数
                if(data.status_code == 200){
                                layer.alert(data.res, {
                                        icon: 1,
                                        time:1500,
                                        end:function () {
                                            setInterval(function(){
                                                window.location.href = '/login';
                                            },500)

                                        }
                                    },
                                );
                            }
                            else{
                                layer.alert(data.res, {
                                        icon: 5,
                                    },
                                    function() {
                                        //关闭当前frame
                                        xadmin.close();

                                        // 可以对父窗口进行刷新
                                        xadmin.father_reload();
                                    });
                            }
            },
            error: function(xhr, status, error) {
                console.error("An error occurred: " + status + "\nError: " + error);
            }
        });
    }
    });
        
    })
    )
</script>
 

@include('home.mobile.footer')



 <!----></body></html>